// import { title } from 'process'
import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
const login=()=>import("@/views/login/index.vue")
const layout=()=>import("@/views/layout/index.vue")
const home=()=>import("@/views/home/index.vue")

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: login,
      meta:{title:"登陆页"}
    },
    {
      path: '/',
      name: 'layout',
      children:[{
        path: "/home",
        component: home,
      }
       
      ]
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      // component: () => import('../views/AboutView.vue')
    },
    {
      path:"/404",
      component:()=>import("@/views/common/error/404.vue")
    },
    {
      path:"/:pathMatch(.*)",
      redirect:'/404'
      
    }
  ]
 
})


export default router
